
def check(x, group):
    for y in group:
        if y % x == 0 or x % y ==0:
            return False
    return True

def dfs(depth):
    global ans
    if len(Groups) > ans:
        return
    if depth == n:
        ans = min(ans, len(Groups))
        return

    for each_group in Groups:
        if check(a[depth], each_group):
            each_group.append(a[depth])
            dfs(depth + 1)
            each_group.pop()
    else:
        Groups.append([a[depth]])
        dfs(depth + 1)
        Groups.pop()



n = int(input())
a = list(map(int, input().split()))
Groups = []
ans = n
dfs(0)
print(ans)

